package com.gs.synedocket.util;

import com.gs.synedocket.db.dto.DocketAccRepDto;
import com.gs.synedocket.db.dto.DocketAdditionalDto;
import com.gs.synedocket.db.entity.DocketPhoto;

import java.util.Date;
import java.util.List;

public class DocketUtil {
    private static volatile DocketUtil instance;

    private Double loadQty;
    private String docketId = "";
    private String docketNo;
    private String qrCodeAuth;
    private String qrCodeCus;
    private String qrCodeKWah;
    private String docketSite = "";
    private Integer truckState;
    private Integer driverState;
    private Integer qcState;
    private String truckNo;
    private DocketAccRepDto accRep;
    private DocketAdditionalDto additional;
    private String driverRemark;
    private List<DocketPhoto> photos;
    private Date arriveSiteAt;
    private String arriveSiteGps;
    private Date startDisAt;
    private String startDisGps;
    private Date endDisAt;
    private String endDisGps;
    private Date arrivePlantAt;
    private String arrivePlantGps;
    private Date leaveSiteAt;
    private String leaveSiteGps;

    private Integer upload;
    private int upgradeLevel;

    private boolean isLogDetail;

    public static DocketUtil getInstance() {
        if (instance == null) {
            synchronized (DocketUtil.class) {
                if (instance == null) {
                    instance = new DocketUtil();
                }
            }
        }
        return instance;
    }

    public void refresh() {
        loadQty = null;
        docketId = "";
        docketNo = null;
        truckState = null;
        qcState = null;
        driverState = null;
        docketSite = "";
        accRep = null;
        driverRemark = null;
        photos = null;
        additional = null;
        isLogDetail = false;
        upload = null;
        truckNo = null;
        refreshQRCode();
        refreshTime();
    }

    public void refreshQRCode() {
        qrCodeAuth = null;
        qrCodeCus = null;
        qrCodeKWah = null;
    }

    public void refreshTime() {
        arriveSiteAt = null;
        startDisAt = null;
        endDisAt = null;
        leaveSiteAt = null;
        arrivePlantAt = null;
        arriveSiteGps = null;
        startDisGps = null;
        endDisGps = null;
        leaveSiteGps = null;
        arrivePlantGps = null;
    }

    public String getTruckNo() {
        return truckNo;
    }

    public void setTruckNo(String truckNo) {
        this.truckNo = truckNo;
    }

    public boolean isLogDetail() {
        return isLogDetail;
    }

    public void setLogDetail(boolean logDetail) {
        isLogDetail = logDetail;
    }

    public String getDocketId() {
        return docketId;
    }

    public void setDocketId(String docketId) {
        this.docketId = docketId;
    }

    public Double getLoadQty() {
        return loadQty;
    }

    public void setLoadQty(Double loadQty) {
        this.loadQty = loadQty;
    }

    public String getDocketNo() {
        return docketNo;
    }

    public void setDocketNo(String docketNo) {
        this.docketNo = docketNo;
    }

    public String getQrCodeAuth() {
        return qrCodeAuth;
    }

    public void setQrCodeAuth(String qrCodeAuth) {
        this.qrCodeAuth = qrCodeAuth;
    }

    public String getQrCodeCus() {
        return qrCodeCus;
    }

    public void setQrCodeCus(String qrCodeCus) {
        this.qrCodeCus = qrCodeCus;
    }

    public String getQrCodeKWah() {
        return qrCodeKWah;
    }

    public void setQrCodeKWah(String qrCodeKWah) {
        this.qrCodeKWah = qrCodeKWah;
    }

    public Date getArriveSiteAt() {
        return arriveSiteAt;
    }

    public void setArriveSiteAt(Date arriveSiteAt) {
        this.arriveSiteAt = arriveSiteAt;
    }

    public Date getStartDisAt() {
        return startDisAt;
    }

    public void setStartDisAt(Date startDisAt) {
        this.startDisAt = startDisAt;
    }

    public Date getEndDisAt() {
        return endDisAt;
    }

    public void setEndDisAt(Date endDisAt) {
        this.endDisAt = endDisAt;
    }

    public Integer getTruckState() {
        return truckState;
    }

    public void setTruckState(Integer truckState) {
        this.truckState = truckState;
    }

    public Integer getQcState() {
        return qcState;
    }

    public void setQcState(Integer qcState) {
        this.qcState = qcState;
    }

    public Integer getDriverState() {
        return driverState;
    }

    public void setDriverState(Integer driverState) {
        this.driverState = driverState;
    }

    public String getDocketSite() {
        return docketSite;
    }

    public void setDocketSite(String docketSite) {
        this.docketSite = docketSite;
    }

    public DocketAccRepDto getAccRep() {
        return accRep;
    }

    public void setAccRep(DocketAccRepDto accRep) {
        this.accRep = accRep;
    }

    public DocketAdditionalDto getAdditional() {
        return additional;
    }

    public void setAdditional(DocketAdditionalDto additional) {
        this.additional = additional;
    }

    public String getDriverRemark() {
        return driverRemark;
    }

    public void setDriverRemark(String driverRemark) {
        this.driverRemark = driverRemark;
    }

    public List<DocketPhoto> getPhotos() {
        return photos;
    }

    public void setPhotos(List<DocketPhoto> photos) {
        this.photos = photos;
    }

    public static void setInstance(DocketUtil instance) {
        DocketUtil.instance = instance;
    }

    public String getArriveSiteGps() {
        return arriveSiteGps;
    }

    public void setArriveSiteGps(String arriveSiteGps) {
        this.arriveSiteGps = arriveSiteGps;
    }

    public String getStartDisGps() {
        return startDisGps;
    }

    public void setStartDisGps(String startDisGps) {
        this.startDisGps = startDisGps;
    }

    public String getEndDisGps() {
        return endDisGps;
    }

    public void setEndDisGps(String endDisGps) {
        this.endDisGps = endDisGps;
    }

    public String getArrivePlantGps() {
        return arrivePlantGps;
    }

    public void setArrivePlantGps(String arrivePlantGps) {
        this.arrivePlantGps = arrivePlantGps;
    }

    public String getLeaveSiteGps() {
        return leaveSiteGps;
    }

    public void setLeaveSiteGps(String leaveSiteGps) {
        this.leaveSiteGps = leaveSiteGps;
    }

    public Date getLeaveSiteAt() {
        return leaveSiteAt;
    }

    public void setLeaveSiteAt(Date leaveSiteAt) {
        this.leaveSiteAt = leaveSiteAt;
    }

    public Date getArrivePlantAt() {
        return arrivePlantAt;
    }

    public void setArrivePlantAt(Date arrivePlantAt) {
        this.arrivePlantAt = arrivePlantAt;
    }

    public Integer getUpload() {
        return upload;
    }

    public void setUpload(Integer upload) {
        this.upload = upload;
    }

    public int getUpgradeLevel() {
        return upgradeLevel;
    }

    public void setUpgradeLevel(int upgradeLevel) {
        this.upgradeLevel = upgradeLevel;
    }
}
